package com.nifostasky.config;

import com.nifostasky.config.fallback.FallbackFeign;
import com.nifostasky.entity.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//@RequestMapping("/student") fallback方式不能有该注解;
@FeignClient(value = "springcloud-controller",contextId = "student",fallback = FallbackFeign.class)
public interface StudentFeignClient {
    /**
     *
     *
     * 这个方法必须和调用的服务方法一模一样;
     * @param id
     * @return
     */
    @GetMapping("/student/queryUserById/{id}")
    Student queryUserById(@PathVariable("id") Integer id);

}
